﻿using System.Linq.Expressions;

namespace System.Data.SQL.Linq.Expressions
{
    public enum SQLNodeType
    {
        Table,
        Select,
        Insert,
        Update,
        Delete
    }

    public abstract class SQLNode
    {
        public SQLNodeType NodeType { get; private set; }
        public Expression SourceExpression { get; set; }

        protected SQLNode(SQLNodeType nodeType, Expression sourceExpression) 
        {
            NodeType = nodeType;
            SourceExpression = sourceExpression;
        }
    }
    //////////////////////////////////////////////////////////////////////////
    public abstract class SQLExpression : SQLNode
    {
        public Type ClrTyle { get; private set; }

        internal SQLExpression(SQLNodeType nodeType, Type clrType, Expression sourceExpression)
            : base(nodeType, sourceExpression)
        {
            ClrTyle = clrType;
        }
    }
    public abstract class SQLStatement : SQLNode
    {
        public SQLStatement(SQLNodeType nodeType, Expression sourceExpression)
            : base(nodeType, sourceExpression)
        {
        }
    }
    public abstract class SQLSource : SQLNode
    {
        public SQLSource(SQLNodeType nodeType, Expression sourceExpression)
            : base(nodeType, sourceExpression)
        {
        }
    }
}
